Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reline#readline and Reline#readmultiline to private. #67

Merged
merged 2 commits into from
Nov 11, 2019

Conversation

osyo-manga
Copy link
Contributor

Summary

  • Reline#readline and Reline#readmultiline to private
  • (Reline.readline and Reline.readmultiline to module_function)

Steps to reproduce

  1. include Reline
  2. call #readline with receiver.
class X
  include Reline
end
x = X.new
x.readline

Expected behavior

require "reline"

class X
  include Reline
end
x = X.new

# No error: call without receiver
x.instance_eval { readline }

# Error: private method `readline' called for #<X:0x00007f8a049252d0> (NoMethodError)
x.readline

Actual behavior

require "reline"

class X
  include Reline
end
x = X.new

# No error: call without receiver
x.instance_eval { readline }

# No error
x.readline

Note

  • Readline#readline is private
  • (Readline.readline is module_function)
  • I think Reline needs to be compatible with Readline
    • readmultiline also needs to follow readline
require "readline"

class X
  include Readline
end
x = X.new

# OK
x.instance_eval { readline }

# Error: private method `readline' called for #<X:0x00007f8a049252d0> (NoMethodError)
x.readline

@osyo-manga osyo-manga marked this pull request as ready for review November 10, 2019 07:40
test/reline/test_reline.rb Outdated Show resolved Hide resolved
@aycabta aycabta merged commit 8bd2a1a into ruby:master Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants